:- module(webdb_client, [main/0], [actmods]).

%%%%%%%%%%%%%%%%%%%%%%%%%%%% Needed modules %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
:- use_active_module(dbserver, [db_handler/3]).
:- use_module(library('actmods/filebased_locate')).
:- use_module(library('pillow/html')).
:- use_module(search(utils), [log_message/1]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Defined predicates  %%%%%%%%%%%%%%%%%%%%%%%%

main:- 
        log_message('webdb_client CGI started'),
	html_protect(main1). % To see errors in Netscape

main1:-
        log_message('webdb_client: getting input from form'),
	get_form_input(Input),!,
        log_message('webdb_client: got input'(Input)),
	db_handler(Input,_, Response),
        log_message('webdb_client: answer received'),
	output_html(Response).

%% Version comment prompting control for this file.
%% Local Variables: 
%% mode: CIAO
%% update-version-comments: "off"
%% End:

